package com.swanclouds.redfish.common.redfish;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.ModelEntity;

import java.util.List;

/**
 * ${DESCRIPTION}
 *
 * @author 张立强
 */
@JsonRootName("Boot")
public class Boot implements ModelEntity {

    /**
     * 系统启动模式[Legacy,UEFI]
     */
    @JsonProperty("BootSourceOverrideMode")
    private String bootSourceOverrideMode;

    /**
     * 启动参数的使能状态 [Disabled:不生效; Once:仅生效一次,即下次重启时生效; Continuous:永久有效]
     */
    @JsonProperty("BootSourceOverrideEnabled")
    private String bootSourceOverrideEnabled;

    /**
     * 下次引导时使用的引导源
     */
    @JsonProperty("BootSourceOverrideTarget")
    private String bootSourceOverrideTarget;

    /**
     * Redfish 定义的启动设备
     */
    @JsonProperty("BootSourceOverrideTarget@Redfish.AllowableValues")
    private List<String> bootSourceOverrideTargetValues;

    public String getBootSourceOverrideMode() {
        return bootSourceOverrideMode;
    }

    public void setBootSourceOverrideMode(String bootSourceOverrideMode) {
        this.bootSourceOverrideMode = bootSourceOverrideMode;
    }

    public String getBootSourceOverrideEnabled() {
        return bootSourceOverrideEnabled;
    }

    public void setBootSourceOverrideEnabled(String bootSourceOverrideEnabled) {
        this.bootSourceOverrideEnabled = bootSourceOverrideEnabled;
    }

    public String getBootSourceOverrideTarget() {
        return bootSourceOverrideTarget;
    }

    public void setBootSourceOverrideTarget(String bootSourceOverrideTarget) {
        this.bootSourceOverrideTarget = bootSourceOverrideTarget;
    }

    public List<String> getBootSourceOverrideTargetValues() {
        return bootSourceOverrideTargetValues;
    }

    public void setBootSourceOverrideTargetValues(List<String> bootSourceOverrideTargetValues) {
        this.bootSourceOverrideTargetValues = bootSourceOverrideTargetValues;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "Boot {" +
                "bootSourceOverrideMode='" + bootSourceOverrideMode + '\'' +
                ", bootSourceOverrideEnabled='" + bootSourceOverrideEnabled + '\'' +
                ", bootSourceOverrideTarget='" + bootSourceOverrideTarget + '\'' +
                ", bootSourceOverrideTargetValues=" + bootSourceOverrideTargetValues +
                '}';
    }
}
